<?php

function smarty_function_url_to ( $params, &$smarty )
{
    
	if ( empty ( $params['controller'] ) )
	{
		
		return System::urlTo ( ) ;
		
	}
	else
	{
		
		if ( empty ( $params['action'] ) )
		{
			
			return System::urlTo ( $params['controller'] ) ;
			
		}
		else
		{
			
			if ( empty ( $params['params'] ) )
			{
				
				return System::urlTo ( $params['controller'], $params['action'] ) ;
				
			}
			else
			{
				
				return System::urlTo ( $params['controller'], $params['action'], $params['params'] ) ;
				
			}
			
		}
		
	}
    
}

?>